#ifndef __CACHEMANAGER_HPP__
#define __CACHEMANAGER_HPP__

#include "LRUCache.hpp"
#include "CacheGroup.hpp"

#include <vector>
using std::vector;

class CacheManager {
public:
    //创建单例实例
    static CacheManager *getInstance();
    //获取Cache组中的某一个Cahe
    CacheGroup &getCacheGroup(size_t);
    //同步Cache
    void sync();

private:
    CacheManager();
    ~CacheManager() {};
    static void destroy();

private:
    //cache块数
    size_t _cacheNum;
    //一个Cache的最大容量
    size_t _maxRecordNum;
    //Cache组
    vector<CacheGroup> _caches;
    static CacheManager *_pInstance;
};
#endif
